package cn.tedu.self;

import java.util.Arrays;
import java.util.Random;

public class Sort {
    public static void main(String[] args) {
        int[] a=new int[5];
        for(int i=0;i<=4;i++){
            a[i]=new Random().nextInt(100);
        }
        System.out.println(Arrays.toString(a));
        Arrays.sort(a);

        System.out.println(Arrays.toString(a));
        int[] b;
        b = Arrays.copyOfRange(a,2,4);

        System.out.println(Arrays.toString(b));
    }
}
